<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh">
<link href="<%=path%>/bootstrap/css/bootstrap.css" rel="stylesheet">
<script type="text/javascript" src="<%=path%>/bootstrap/js/jquery-3.4.1.js"></script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>游艇俱乐部管理系统</title>
</head>
<body>
	<div class="container">
		<form action="<%=path%>/login.do" name="myForm" method="post" onsubmit="return checkForm()">
			账    号：<input id="account" name="account" value="" type="text" >
			密    码：<input id="password" name="password" value="" type="password">
			<label>
				<input id="remember" name="remember" type="checkbox" value="remember-me">记住我
				<font id="error" color="red">${error}</font>
			</label>
			<input type="submit" value="登录">
		</form>
		<br>
		<div  style="text-align: center"><a href="register.jsp"><button>注册</button></a></div>
		
	</div>
</body>

<style type="text/css">
	body{
		background-image: url("<%=path%>/image/background2.jpg");
		background-attachment: fixed;
		background-position: center;
		background-repeat: no-repeat;
		background-size: 100%
	}
	
	form {
		margin-top:200px;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}
</style>

<script type="text/javascript">
	function checkForm(){
		var account=document.getElementById("account").value;
		var password=document.getElementById("password").value;
		if(account == null || account == ""){
			document.getElementById("error").innerHTML =  "学号不为空";
			return false;
		}
		if(password == null || password == "") {
			document.getElementById("error").innerHTML =  "密码不为空";
			return false;
		}
		
		return true;
	}
</script>
</html>